<template>
  <div id="test">
  <el-container>
    <el-header></el-header>
    <el-main>
      <router-view></router-view>
    </el-main>
    <el-footer>
      <el-button icon="el-icon-back" size="medium" round @click="backTo" :disabled="currentIdx - 1 < 0"></el-button>
      <el-button icon="el-icon-right" size="medium" round @click="nextTo" :disabled="currentIdx + 1 > maxIdx"></el-button>
    </el-footer>
  </el-container>
  </div>
</template>

<script>
  export default {
    name: "Test",
    data() {
      return {
        page_list: ['index', 'basic', 'classify'],
        allComponents: [],
        firstPage: 'index', // list[0]
        lastPage: 'classify', //list[list.length]
        currentIdx: 0,
        maxIdx: 3 //list.length
      }
    },
    methods: {
      backTo() {
        --this.currentIdx
        this.$router.push('/' + this.page_list[this.currentIdx])
      },
      nextTo() {
        ++this.currentIdx
        this.$router.push('/' + this.page_list[this.currentIdx])
      }
    }
  }
</script>

<style scoped>
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    /*       line-height: 700px; */
  }

  .el-header,
  .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .container {
    margin: 0 auto;
    width: 90%;
    min-height: 90%;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 850px;
  }

  .container .footer {
    width: 80%;
    height: 50px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
  }

  .container .footer el-button {
    width: 50px;
  }
</style>
